home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The AGA Experience 2
/
agavol2.iso
/
software
/
utilities
/
emulation
/
zxam spectrum
/
zxam_rexx
/
english
/
savez80.zxam
< prev
next >
Wrap
Text File
|
1995-07-31
|
2KB
|
57 lines
/* This script saves the actual program in Z80 1.45 format */
/* check if the emulator is present */
address command
if ~show(ports,ZXAM_REXX) then do
requestchoice 'title "ZXAM Script error..." body "I cant find the emulator port!!" gadgets "AARGH!"'
exit
end
/* store the initial status of the emulator */
running=zxamactrun() /* 1=running */
zxamstop() /* stop the emulation */
/* SAVE requester */
oldpath=zxamactsavepath()
oldpattern=zxamactpattern()
zxampattern('#?.Z80')
nombre=zxamsaverequester('Name for the .Z80 file...')
zxamsavepath(oldpath)
zxampattern(oldpattern)
if nombre='' then exit 0 /* CANCEL */
/* open the file */
if ~open('fichero',nombre,'W') then exit 0
/* write all the registers */
dummy=writech('fichero',d2c(zxamgetreg(a)))
dummy=writech('fichero',d2c(zxamgetreg(f)))
dummy=writech('fichero',d2c(zxamgetreg(cb),2))
dummy=writech('fichero',d2c(zxamgetreg(lh),2))
dummy=writech('fichero',d2c(zxamgetreg(cp),2))
dummy=writech('fichero',d2c(zxamgetreg(ps),2))
dummy=writech('fichero',d2c(zxamgetreg(i)))
dummy=writech('fichero',d2c(zxamgetreg(r)))
dummy=writech('fichero',d2c((zxamgetreg(bor)*2)+(zxamgetreg(r)%128)))
dummy=writech('fichero',d2c(zxamgetreg(ed),2))
dummy=writech('fichero',d2c(zxamgetreg(cb2),2))
dummy=writech('fichero',d2c(zxamgetreg(ed2),2))
dummy=writech('fichero',d2c(zxamgetreg(lh2),2))
dummy=writech('fichero',d2c(zxamgetreg(a2)))
dummy=writech('fichero',d2c(zxamgetreg(f2)))
dummy=writech('fichero',d2c(zxamgetreg(yi),2))
dummy=writech('fichero',d2c(zxamgetreg(xi),2))
dummy=writech('fichero',d2c(zxamgetreg(int)))
dummy=writech('fichero',d2c(0))
dummy=writech('fichero',d2c(zxamgetreg(im)))
dummy=writech('fichero',zxamgetmem(16384,49152))
dummy=close('fichero')
/* restore the status */
if running=1 then zxamrun()
exit